//
//  RootViewController.m
//  AnimationRecommend
//
//  Created by ljm on 2017/2/14.
//  Copyright © 2017年 ljm. All rights reserved.
//

#import "RootViewController.h"
#import "TabBarViewController.h"
#import "LaunchViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = AllBackColor;
    
    [self setControllers];
    [self registNotifications];
}

- (void)registNotifications {
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showLaunchVcs) name:@"showLaunchVcs" object:nil];
}

- (void)setControllers {
    [self showTabbarVcs];
    [self showLaunchVcs];
}

- (void)showTabbarVcs {
    TabBarViewController *tvc = [[TabBarViewController alloc]init];
    [self addChildViewController:tvc];
    [self.view addSubview:tvc.view];
    self.TBVC = tvc;
}

- (void)showLaunchVcs {
    LaunchViewController *lvc = [[LaunchViewController alloc]init];
    [self addChildViewController:lvc];
    [self.view addSubview:lvc.view];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
